package com.fw.demo.model;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fw.common.model.AbstractModel;

@Entity
@Table(name="tb_auths")
public class Auth extends AbstractModel{
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "rec_Id", nullable = false, length = 36)
	private Long recid;							//序号
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_Id")				//上一级权限
	private Auth auth;
	@Column(name = "auth_Desc", length = 200)		//权限的注释
	private String authDesc;
	@Column(name = "auth_Name", length = 100)	//权限的名称
	private String authName;
	@Column(name = "auth_SEQ", precision = 22, scale = 0)
	private BigDecimal authSeq;						//同一级权限的排序，比如菜单的先后排序
	@Column(name = "auth_Url", length = 300)
	private String authUrl;							// 权限连接 比如菜单，按钮，超链接的 url，
	@Column(name = "auth_Type", length = 20)
	private String authType;						//权限类型 有菜单 1，按钮 2，超链接 3；
	@Column(name = "auth_Level", length = 20)
	private String authLevel;						//权限等级，分为一级菜单 1，二级菜单 2，三级菜单 3 ，按钮跟超链接为四级菜单 4	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "auth")
	private Set<RoleAuth> roleauths = new HashSet<RoleAuth>(0);
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "auth")
	private Set<Auth> auths = new HashSet<Auth>(0);
	public Long getRecid() {
		return recid;
	}
	public Auth getAuth() {
		return auth;
	}
	public void setAuth(Auth auth) {
		this.auth = auth;
	}
	public String getAuthDesc() {
		return authDesc;
	}
	public void setAuthDesc(String authDesc) {
		this.authDesc = authDesc;
	}
	public String getAuthName() {
		return authName;
	}
	public void setAuthName(String authName) {
		this.authName = authName;
	}
	public BigDecimal getAuthSeq() {
		return authSeq;
	}
	public void setAuthSeq(BigDecimal authSeq) {
		this.authSeq = authSeq;
	}
	public String getAuthUrl() {
		return authUrl;
	}
	public void setAuthUrl(String authUrl) {
		this.authUrl = authUrl;
	}
	public String getAuthType() {
		return authType;
	}
	public void setAuthType(String authType) {
		this.authType = authType;
	}
	public String getAuthLevel() {
		return authLevel;
	}
	public void setAuthLevel(String authLevel) {
		this.authLevel = authLevel;
	}
	public Set<RoleAuth> getRoleauths() {
		return roleauths;
	}
	public void setRoleauths(Set<RoleAuth> roleauths) {
		this.roleauths = roleauths;
	}
	public Set<Auth> getAuths() {
		return auths;
	}
	public void setAuths(Set<Auth> auths) {
		this.auths = auths;
	}
	public void setRecid(Long recid) {
		this.recid = recid;
	}
	
	
}
